<template>
  <div class="admin-dashboard">
    <el-row :gutter="20">
      <el-col :span="24">
        <el-card class="welcome-card">
          <template #header>
            <div class="card-header">
              <span>管理员仪表盘</span>
            </div>
          </template>
          <div class="welcome-content">
            <h2>欢迎来到管理员仪表盘！</h2>
            <p>您已成功以管理员身份登录系统。</p>
            <p>当前用户信息：{{ userInfo.username }} ({{ userInfo.role }})</p>
          </div>
        </el-card>
      </el-col>
    </el-row>
    <el-row :gutter="20" style="margin-top: 20px;">
      <el-col :span="6">
        <el-card class="stat-card">
          <div class="stat-content">
            <div class="stat-number">25</div>
            <div class="stat-label">总活动数</div>
          </div>
        </el-card>
      </el-col>
      <el-col :span="6">
        <el-card class="stat-card">
          <div class="stat-content">
            <div class="stat-number">156</div>
            <div class="stat-label">总用户数</div>
          </div>
        </el-card>
      </el-col>
      <el-col :span="6">
        <el-card class="stat-card">
          <div class="stat-content">
            <div class="stat-number">89</div>
            <div class="stat-label">今日预约</div>
          </div>
        </el-card>
      </el-col>
      <el-col :span="6">
        <el-card class="stat-card">
          <div class="stat-content">
            <div class="stat-number">12</div>
            <div class="stat-label">进行中活动</div>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script setup>
import { computed } from 'vue'

// 获取用户信息
const userInfo = computed(() => {
  return JSON.parse(localStorage.getItem('userInfo') || '{}')
})
</script>

<style scoped>
.admin-dashboard {
  padding: 20px;
}

.welcome-card {
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.welcome-content {
  text-align: center;
  padding: 20px;
}

.welcome-content h2 {
  color: #2c3e50;
  margin-bottom: 10px;
}

.welcome-content p {
  color: #7f8c8d;
  margin: 5px 0;
}

.stat-card {
  text-align: center;
}

.stat-content {
  padding: 20px;
}

.stat-number {
  font-size: 2.5em;
  font-weight: bold;
  color: #409EFF;
  margin-bottom: 10px;
}

.stat-label {
  color: #7f8c8d;
  font-size: 14px;
}
</style> 